package ticketing_system.Factory;

import java.util.Scanner;

public class Child extends User {
    @Override
    public Double price() {
        System.out.print("请输入儿童年龄:");
        Scanner sc = new Scanner(System.in);
        int age = sc.nextInt();
        double res = super.price();
        if (age <= 10 && res >= 20) {
            double price = res - 10;
            System.out.println("您需要支付" + price + "元");
        } else {
            System.out.println("您需要支付" + res + "元");
        }
         return null;
    }
}